@import "../../../assets/css/tailwind.css";
:host {
  @apply text-xs sm:text-xs md:text-xs lg:text-xs xl:text-sm 2xl:text-sm;
  display: block;
  width: 100%;
  transition: width 0.3s;
  background: #283746;
  color: white;
  height: 100%;
  position: relative;
}

.menu-content {
  padding: 10px 0;
}

.search-box {
  width: calc(100%);
  padding: 8px 8px;
  display: flex;
  align-items: center;
  justify-content:space-between;
}

.collapse-box {
  cursor: pointer;
  padding: 3px;
  margin-left: 10px;
  border-radius: 5px;
}

.collapse-box:hover {
  background: #d0d7dd3d;
}

input {
  @apply grow;
  padding: 3px;
  border-radius: 4px;
  border: none;
  background: #34495e;
  color: white;
}

.menu-item {
  padding: 0 0;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  position: relative;
  span {
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 5px;
  }
}
/* .menu-items>.menu-item>span:hover {
  background: rgba(0, 243, 255, 0.1);
} */

.menu-item.expanded .children {
  background: #38506938;
}
.menu-item > span {
  display: inline;
  width: 100%;
}
.contract {
  .menu-item .title {
    display: none;
  }
  .search-box input{
    display: none;
  }
}
.menu-item > span:hover {
  background: rgba(0, 243, 255, 0.1);
}
/* .children .menu-item:hover {
  background: rgba(0, 243, 255, 0.1);
} */
/* 悬停动画 */
.children .menu-item span:hover :not(.icon) {
  /* animation: icon-float 1s ease infinite; */
}
.children .menu-item:not(:has(.children)) :hover .icon {
  margin-left: 5px;
}

@keyframes icon-float {
  0%,
  100% {
    transform: translateY(0);
    padding-right: 0px;
  }
  50% {
    padding-right: 20px;
  }
}

.menu-item:hover {
  /* background:rgba(0, 243, 255, 0.1); */
  /* background: #34495e; */
}

.icon {
  transition: margin 0.3s;
}

.title {
  white-space: nowrap;
}

.children {
  max-height: 0;
  opacity: 0;
  visibility: visible;
  overflow: hidden;
  transition: all 0.3s;
  /* background: rgb(0 0 0 / 20%); */
  width: 100%;
}

.children .menu-item {
  padding: 0 0;
}
.expanded > .children {
  visibility: visible;
  max-height: 300px;
  opacity: 1;
}

.arrow {
  color: white;
  margin-left: auto;
  transition: transform 0.3s;
  display: inline-block;
}

.expanded > span .arrow {
  transform: rotate(90deg);
}

.toggle-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  cursor: pointer;
  padding: 5px;
  background: #34495e;
  border-radius: 4px;
}

.active {
  background: linear-gradient(
    90deg,
    rgba(0, 243, 255, 0.2) 0%,
    rgba(0, 243, 255, 0) 100%
  );
  border: 1px solid #91faff;
}
